package com.cusc.module_apply.mvvm.ui.activity;

import android.view.Menu;

import androidx.lifecycle.ViewModelProvider;

import com.cusc.module_apply.BR;
import com.cusc.module_apply.R;
import com.cusc.module_apply.databinding.ActApplyMainSearchBinding;
import com.cusc.module_apply.factory.ApplyViewModuleFactory;
import com.cusc.module_apply.mvvm.vm.ApplyActMainViewModel;
import com.tcgroup.phone.base_core.framework.mvvm.activity.ContainerMvvmActivity;
import com.tcgroup.phone.base_core.utils.KLog;

/**
 * 作者: wangfei
 * 创建时期: 2020/4/21.
 * 包名: com.cusc.module_apply.mvvm.ui.activity
 * 类名: OSAndroidMvvm
 */
public class ApplyMainSearchActivity extends ContainerMvvmActivity<ActApplyMainSearchBinding, ApplyActMainViewModel> {


    @Override
    public int onBindVariableId() {
        return BR.model;
    }

    @Override
    public Class<ApplyActMainViewModel> onBindViewModel() {
        return ApplyActMainViewModel.class;
    }

    @Override
    public ViewModelProvider.Factory onBindViewModelFactory() {
        return ApplyViewModuleFactory.getInstance(getApplication());
    }

    @Override
    public void initViewObservable() {

    }

    @Override
    public void onRetryBtnClick() {

    }

    @Override
    public void onBackPressedClick() {

    }

    @Override
    public int onBindLayout() {
        return R.layout.act_apply_main_search;
    }

    @Override
    public Object bindLoadSir() {
        return this;
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.layout_clean,menu);
        return true;
    }

    @Override
    public void initContentView() {
        super.initContentView();
        mToolbar.inflateMenu(R.menu.layout_clean);
        mToolbar.setOnMenuItemClickListener(item -> {
            if (item.getItemId() == R.id.menu_clean){
                KLog.i("TAG","数据"+ mViewModel.ycrModel.get().getContent());
                return true;
            }
            return true;
        });
    }

    @Override
    public void initData() {
        super.initData();
        mViewModel.getDictStatues();
    }
}
